<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;

use App\Models\Product;

class ProductController extends Controller
{

    public function getCurrentProduct()
    {
        $product = session('product');

        if (! $product) {
            return response()->json(['code' => 1001, 'message' => '暂未选择商品'], 400);
        }

        return response()->json(['code' => 1, 'data' => $product]);
    }
}
